package com.mixsmart.core.search.filter;

import com.mixsmart.utils.StringUtils;

/**
 * 过滤参数对象转化为 字符串
 * @author lmq
 * @version 1.0
 * @since 1.0
 * 2015年11月7日
 */
public class SearchFilterConverString extends AbstractConverSearchFilter {
	
	public SearchFilterConverString(SearchFilter searchParam) {
		super(searchParam);
	}

	@SuppressWarnings({ "unchecked", "hiding" })
	@Override
	public <String> String getResult() {
		String param = null;
		if(null != super.params && !super.params.isEmpty()) {
			StringBuilder strBuilder = new StringBuilder();
			for(java.lang.String key : super.params.keySet()) {
				strBuilder.append(key+"="+StringUtils.handNull(super.params.get(key))+"&");
			}
			strBuilder.delete(strBuilder.length()-1, strBuilder.length());
			param = (String) strBuilder.toString();
		}
		return param;
	}

	
}
